package com.shell.qq.sql;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import androidx.annotation.Nullable;

public class DBHelper extends SQLiteOpenHelper {
    public DBHelper(@Nullable Context context, @Nullable String name, @Nullable SQLiteDatabase.CursorFactory factory, int version) {
        super(context, name, factory, version);
    }
    public DBHelper(Context context){
        //上下文，创建数据库名字，工厂，版本
        super(context,DBUtil.DB_NAME,null,1);
    }

    @Override
    //第一次创建数据库时会自动调用这个方法
    public void onCreate(SQLiteDatabase db) {
        db.execSQL(DBUtil.CREATE_TABLE);//创建数据表
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}

